<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCollectTable20230907 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('collect')) {
            Schema::create('collect', function (Blueprint $table) {
                $table->id();
                $table->integer('member_id')->index()->unsigned()->comment('会员id');
                $table->string('belong_type')->index()->comment('关联类型');
                $table->integer('belong_id')->comment('关联id');
                $table->timestamps();
                $table->comment = '收藏表';
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
